﻿@page "/test/alltypes"
@inherits AppComponentBase
@using MyApp.ServiceModel
@using ServiceStack.Text

<h1 class="mb-4 text-2xl">AllTypesTest</h1>

<button @onclick="submit" class="rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
    All Types
</button>


@if (Api != null)
{
    if (Api.Succeeded)
    {
        <h2 class="mt-8 text-2xl text-green-800">Success!</h2>
        <pre>@Api.Response.Dump()</pre>
    }
    else
    {
        <h2 class="mt-8 text-2xl text-red-600">ERROR!</h2>
        <pre>@Api.Error.Dump()</pre>
    }
}

@code {
    ApiResult<HelloAllTypesResponse> Api;

    async Task submit()
    {
        Api = await ApiAsync(new HelloAllTypes {
            AllTypes = AllTypes.Create(1)
        });
    }
}
